package com.google.code.jmarias.common;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 *
 * @author Ondrej Michal
 */
public class NewTable {

    private List<NewPlayer> players = new ArrayList<NewPlayer>();
    private Card trump;
    private CardDeck deck;
    private Card[] talon;

    public void addPlayer(NewPlayer player) {
        players.add(player);
    }



    @Override
    public String toString() {
        StringBuffer result = new StringBuffer("Hraci:\n");
        for (NewPlayer player : players) {
            result.append(player).append('\n');
        }
        result.append("Trumfy jsou: ").append(trump).append('\n');
        result.append("Talon: ").append(talon != null ? Arrays.asList(talon) : "null").append('\n');
        return result.toString();
    }

    public NewPlayer getPlayer(int index) {
        return players.get(index);
    }

    public CardDeck getDeck() {
        return deck;
    }

    public void setDeck(CardDeck deck) {
        this.deck = deck;
    }
    
    public List<NewPlayer> getPlayers() {
        return players;
    }

    public void setPlayers(List<NewPlayer> players) {
        this.players = players;
    }

    public Card getTrump() {
        return trump;
    }

    public void setTrump(Card trump) {
        this.trump = trump;
    }

    public Card[] getTalon() {
        return talon;
    }

    public void setTalon(Card[] talon) {
        this.talon = talon;
    }

}
